<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<style type="text/css">
			* {
				font-size:12px;
			}
			body {
				text-align:center;
			}
			fieldset {
				text-align:center;
				margin:auto;
				width:500px;
				color:#333;
				border:#B5B8C8 1px solid;
			}
			legend {
				color:#06c;
				font-weight:800;
				background:#fff;
			}
			ul {
				list-style-type: none;
				margin:8px 0 4px 0;
			}
			li {
				margin-top:4px;
			}
			table {
				color:#2E6E9E;
				margin:auto;
			}
		</style>
	</head>
	<body>
		<fieldset>
			<legend>请输入行记录</legend>
			<table width="470px" height="130px">
				<tr>
					<td>
						编码: 
					</td>
					<td>
						<input type="text" name="code" id="dt_code" size="20"/>
					</td>
					<td>
						名称: 
					</td>
					<td>
						<input type="text" name="name" id="dt_name" size="20"/>
					</td>
					
				</tr>
				<tr>
					<td>
						单位: 
					</td>
					<td>
						<input type="text" name="measurementUnit" id="dt_measurementUnit" size="8"/>
					</td>
					<td>
						来源: 
					</td>
					<td>
						<!-- 
						<select id="dt_source" name="source" style="width:100px;font-size:12px"></select>
						 -->
						 <div id='source_out' style='width:168px;height:25px;'></div>
					</td>
				</tr>
				<tr>
					<td>
						品牌: 
					</td>
					<td>
						<input type="text" name="brand" id="dt_brand" size="15"/>
					</td>
					<td>	
						产地: 
					</td>
					<td>
						<input type="text" name="origin" id="dt_origin" size="15"/>
					</td>
				</tr>
				<tr>
					<td>
						订购数量: 
					</td>
					<td>
						<input type="text" name="orderQuantity" id="dt_orderQuantity" size="20"/>
					</td>
					<td>
						订购价格: 
					</td>
					<td>
						<input type="text" name="price" id="dt_price" size="20"/>
					</td>
				</tr>
				<tr>
					<td align="center" colspan="4">
						<input type="button" id="dt_smt" value="保存"/>
						&nbsp;&nbsp;&nbsp;&nbsp;
						&nbsp;&nbsp;&nbsp;&nbsp;
						<input type="button" id="dt_cac" value="取消"/>
					</td>
				</tr>
			</table>
		</fieldset>
		<script src="/htdocs/js/protype.js" type="text/javascript"></script>
		<script src="/htdocs/js/dictionary_select_combList/comb_list.js" type="text/javascript"></script>
		<script>
			function ff(d) {
				return document.getElementById(d);
			}
			
			window.onload = function() {
				/*
				var dt_source = ff('dt_source');
				for(var i=0; i<top.sourcesJson.length; i++) {
					var opt = new Option(top.sourcesJson[i].varName, top.sourcesJson[i].varIndex);
					dt_source.options[i] = opt;
				}
				*/
				//alert(top.sourcesJson);
				var source_out = ff('source_out');
				var cmbList = new Comb_list(top.sourcesJson, 'dt_source');
				cmbList.setWidth(130);
				cmbList.appendToDiv(source_out);
				
				var dt_code = ff('dt_code');
				dt_code.focus();
				
				var dt_name = ff('dt_name');
				var dt_measurementUnit = ff('dt_measurementUnit');
				var dt_brand = ff('dt_brand');
				var dt_origin = ff('dt_origin');
				var dt_orderQuantity = ff('dt_orderQuantity');
				var dt_price = ff('dt_price');
				var dt_smt = ff('dt_smt');
				var dt_cac = ff('dt_cac');

				function inputSubmit() {
					var source = dt_source.options[dt_source.selectedIndex].text;
					var sourceVlu = dt_source.options[dt_source.selectedIndex].value;
					top.inputDivSubmit(dt_code.value, dt_name.value, source, sourceVlu, dt_measurementUnit.value, dt_brand.value, dt_origin.value, dt_orderQuantity.value, dt_price.value);
				}
				
				dt_smt.onclick = function() {
					inputSubmit();
				};
				dt_cac.onclick = function() {
					top.inputDivCancel();
				};

				window.document.onkeydown = function(evt) {
					evt = (evt) ? evt : window.event;
					if(top.DIV_CTRL && top.DIV_CTRL['input1']) {
						top.escOut(evt);
						if(evt.keyCode == 13) {
							inputSubmit();
						}
					}
				};
					
				top.window.document.onkeydown = function(evt) {
					evt = (evt) ? evt : top.window.event;
					if(top.DIV_CTRL && top.DIV_CTRL['input1']) {
						top.escOut(evt);
						if(evt.keyCode == 13) {
							inputSubmit();
						}
					}
				};
			};
		</script>
	</body>
</html>
